<template>
	<view>
			<uv-tabbar :value="value" zIndex="9999" @change="changeTab" activeColor="#49806F">
					<uv-tabbar-item  v-for="(i,n) in tabbar" :key="n" :text="i.title" >
						<template v-slot:active-icon>
							<image class="icon" :src="i.img_a" mode=""></image>
						</template>
						<template v-slot:inactive-icon>
							<image class="icon" :src="i.img" mode=""></image>
						</template>
					</uv-tabbar-item>
					<!-- <uv-tabbar-item text="放映厅" icon="photo"></uv-tabbar-item>
					<uv-tabbar-item text="直播" icon="play-right"></uv-tabbar-item>
					<uv-tabbar-item text="我的" icon="account"></uv-tabbar-item> -->
				</uv-tabbar>

	</view>
</template>

<script>
	export default {
		props: {
			datas: {
				type: Array,
				default: []
				
			},
			value:{
				type:Number,
				default:0
			}
		},
		data() {
			return {
				
				tabbar:[]
			};
		},
		mounted() {
		uni.hideTabBar()
			this.$api.getCustomTab().then(res=>{
				console.log(res)
				this.tabbar=res.data
			})
			
		},
		onShow() {

		},
		methods: {
		
				changeTab(e){
						let vm =this
					console.log(e)
					if(this.tabbar[e].status=='0'){
							uni.showModal({
								title:this.tabbar[e].status_info
							})
						return
					}
					uni.switchTab({
						url:'/'+this.tabbar[e].url,
						fail:function(){
								uni.navigateTo({
									url:'/'+vm.tabbar[e].url,
								})
						}
					})
				}
		}
	}
</script>

<style lang="scss" scoped>
		.icon{
			width: 50rpx;
			height: 50rpx;
		}
</style>